showWithControls

final Unit showWithControls(Modifier modifier, Function0<Unit> controls, Function1<DrawScope, Unit> sketch)

Shows canvas window as well as controls view side by side. Internally, this starts the Jetpack Compose Window and renders the sketch requested by user into the Jetpack Compose Canvas Composable. The size of the Canvas will be same as the size passed in k5 method by default. One can change the canvas size and window size with the help of modifiers. In order to keep the animation running (rendering canvas continuously), it requests to run the frame of animation in nanos.

Also, you can add your controls like sliders, checkboxes, radio-buttons, pickers etc as a control to change/provide inputs to your sketch. This is just simple Composable function, so you can add all the Composable elements you want. The controls are shown on the right side in the window. You can use Compose States to store/change your input and use it in your sketch.